package com.sunstar.cwcamerademo

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.util.Log

class TestBootReceiver : BroadcastReceiver() {
    override fun onReceive(p0: Context?, p1: Intent?) {
        p1?.action?.let { action ->
            Log.e("TestBootReceiver", "onReceive: ${action}", )
            if (action == Intent.ACTION_BOOT_COMPLETED) {
                val intent = Intent(p0, Splash::class.java)
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK)
                p0?.startActivity(intent)
            }
        }
    }
}